package com.haiya.composite.transparent;

/**
 *                   c0
 *                   /\
 *                  a  c1
 *                     /\
 *                    b  c
 *
 */
public class Client {
    public static void main(String[] args) {
        Component c0 = new Composite();
        Component c1 = new Composite();
        Component l1 = new Leaf("叶子节点a");
        Component l2 = new Leaf("叶子节点b");
        Component l3 = new Leaf("叶子节点c");

        c0.addChild(l1);
        c0.addChild(c1);
        c1.addChild(l2);
        c1.addChild(l3);

        c0.operation();
    }
}
